package edu.ynu.se.xiecheng.achitectureclass.controller;

import edu.ynu.se.xiecheng.achitectureclass.service.SensorRequest;
import edu.ynu.se.xiecheng.achitectureclass.service.SensorDataResponse;
import edu.ynu.se.xiecheng.achitectureclass.service.SensorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/sensor")
public class SensorController {
    private final SensorService sensorService;

    @Autowired
    public SensorController(SensorService sensorService) {
        this.sensorService = sensorService;
    }

    @PostMapping("/get-data")
    public List<SensorDataResponse> getSensorData() {
        return sensorService.getSensorData();
    }
}
